<template>
	<view style="background: #eee;height: 100vh;">
		<!-- <view style="width: 100%;height: 40rpx;background: #eee;"></view> -->
		<!-- <u-tabs :list="list" @click="click"></u-tabs> -->
		<me-tabs :tabs="list" @input="click" :value="value"></me-tabs>
		<!-- 表单区域 -->
		<view style="padding: 26rpx 0;">
			<!-- <view style="padding: 0 20rpx;background: #fff;"> -->

				<!-- 注意，如果需要兼容微信小程序，最好通过setRules方法设置rules规则 -->
				<!-- <u-form :model="from" labelWidth="160rpx">
					<u-form-item label="请假人:" borderBottom>
						<u-input v-model="from.name" disabled=""></u-input>
					</u-form-item>
					<u-form-item label="请假类别:" borderBottom ref="item2">
						<u-input v-model="from.leaveCategory" disabledColor="#ffffff" disabled="">
						</u-input>
					</u-form-item>
					<u-form-item label="开始时间:" borderBottom ref="item2">
						<u-input v-model="from.leaveStartDate" disabledColor="#ffffff" disabled="">
						</u-input>
					</u-form-item>
					<u-form-item label="结束时间:" borderBottom ref="item2">
						<u-input v-model="from.leaveEndDate" disabledColor="#ffffff" disabled="">
						</u-input>
					</u-form-item>
					<u-form-item label="请假时长:" prop="name" borderBottom ref="item3">
						<u-input v-model="from.total+'天'" disabled=""></u-input>
					</u-form-item>
					<u-form-item label="请假事由:" prop="name" borderBottom ref="item4"></u-form-item>
					<textarea v-model="from.leaveReason" disabled="" style="height: 90rpx;font-size: 30rpx;"
						adjust-position></textarea>

					<u-form-item label="联系方式:" prop="name" borderBottom ref="item3">
						<u-input v-model="from.contactWay" disabled=""></u-input>
					</u-form-item>
					<u-form-item label="工作委托人:" prop="name" borderBottom ref="item3">
						<u-input v-model="from.dutyDeputy" disabled=""></u-input>
					</u-form-item>
				</u-form> -->
			<!-- </view> -->
			<view class="btn">
				<u-button type="primary" style="width: 200rpx;height: 80rpx;">取回流程</u-button>
				<u-button type="primary" style="width: 200rpx;height: 80rpx;">作废流程</u-button>
			</view>

		</view>
	</view>
</template>

<script>
	import meTabs from "@/components/me-tabs/me-tabs.vue";
	import {
		getLeave
	} from "@/api/api.js"

	export default {
		comonents:{
			meTabs
		},
		data() {
			return {
				from: {
					name: "张三",
					leaveCategory: "请选择",
					leaveStartDate: "",
					leaveEndDate: "",
					total: 0,
					leaveReason: "感冒",
					contactWay: "13500000000",
					dutyDeputy: "李四"
				},
				id: "",
				list: [{
					name: '表单'
				}, {
					name: '办理记录'
				}, {
					name: '流程图'
				}],
				value:""
			}
		},
		onLoad(e) {
			console.log(e)
			this.id = e.id
		},
		mounted() {
			this.getLeaves()
		},
		methods: {
			// 获取数据
			async getLeaves() {
				let res = await getLeave({
					id: this.id
				})
				console.log(res)
				this.from = res.result
			},
			// 切换tabBar
			click(item) {
				console.log('item', item);
				this.value=item
			}
		}
	}
</script>

<style lang="scss">
	.btn {
		display: flex;
		justify-content: space-between;
		margin-top: 20rpx;
	}
</style>
